public class Tciket {
    private int number = 100;

    public synchronized void  sell() throws InterruptedException {
        if(number > 0){
        System.out.println(Thread.currentThread().getName()+"sell number:"+number);
        number--;
        }
    }
}
